/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

/**
 * Inspired from http://howtodoinjava.com
 * @author Gautier & Sacha
 */
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
 
public class Loader
{
    public static void load(Options[] opt)
    {
        //Input file which needs to be parsed
        String file = "file.txt";
        BufferedReader fileReader = null;
         
        //Delimiter used in CSV file
        final String DELIMITER = ";";
        try
        {
            String line = "";
            //Create the file reader
            fileReader = new BufferedReader(new FileReader(file));
            int i=0;
            //Read the file line by line
            while ((line = fileReader.readLine()) != null)
            {
                
                String[] tokens = line.split(DELIMITER);
                opt[i]= new Options(Double.valueOf(tokens[0]),Double.valueOf(tokens[1]),Double.valueOf(tokens[2]),Double.valueOf(tokens[3]),Double.valueOf(tokens[4]),Double.valueOf(tokens[5]));
                i++;
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        finally
        {
            try {
                fileReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
